<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>{cscms:title}</title>
    <meta name="Keywords" content="{cscms:keywords}" />
    <meta name="Description" content="{cscms:description}" />
    <link rel="shortcut icon" href="{cscms:path}favicon.ico" />
    <link rel="stylesheet" href="{cscms:webpath}packs/font/font.css">
    <link rel="stylesheet" type="text/css" href="{cscms:tempurl}css/pic.css"/>
    <script type="text/javascript" src="{cscms:tempurl}js/user.js"></script>
</head>
<body>
    {cscms:head}
    {cscms:right}
    <div class="layui-tab layui-tab-card" lay-filter="dt1" style="margin-top: 0px;margin-bottom: 0px">
        <ul class="layui-tab-title">
            <li class="layui-this"><a href="javascript:;">上传图片</a></li>
            <li><a href="[user:url userlink=pic,type]">已通过相册</a></li>
            <li><a href="[user:url userlink=pic,verify]">审核中相册</a></li>
            <li><a href="[user:url userlink=pic]">我的图片</a></li>
        </ul>
        <div class="layui-tab-content" style="padding:10px;background-color: #fff">
            <div class="layui-tab-item layui-show">
            <form class="layui-form layui-form-pane" action="[user:picsave]" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">所属分类</label>
                    <div class="layui-input-block">
                        <select name="cid" id="cid">
                        {cscms:class table="pic_list" fid="0" sort="xid" order="asc"}
                            <option value="[class:id]">&nbsp;|—[class:name]</option>
                            {cscmstype:class2 table="pic_list" fid="auto" sort="xid" order="asc"}
                            <option value="[class2:id]">&nbsp;|&nbsp;&nbsp;&nbsp;|—[class2:name]</option>
                            {/cscmstype:class2}
                        {/cscms:class}
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">所属相册</label>
                    <div class="layui-input-block">
                        <input id="sid" name="sid" type="hidden" value="[pic:sid]">
                        <input type="text" name="name" id="name" readonly="true" onclick="cscms.get_open('[user:url userlink=pic,res]/[pic:sid]','选择相册','90%','80%');" value="[pic:name]" required lay-verify="required" class="layui-input">
                    </div>
                </div>
                {cscms:opt_field_pic}
                <input type="hidden" name="token" value="[user:token]"/>
                <div class="layui-form-item">
                    <div class="layui-input-block" style="text-align: center;margin-left: 0px">
                        <a style="" class="layui-btn" href="javascript:uploadPic()">上传图片</a>
                    </div>
                </div>
            </form>
            </div>
        </div>
    </div>
{cscms:bottom}
<script type="text/javascript">
    function uploadPic(){
        var sid = $('#sid').val();
        var cid = $('#cid').val();
        if(sid!='' && sid!=0){
            cscms.get_open('{cscms:webpath}index.php/pic/user/picadd?dir=pic&fid=zpic&type=*.jpg;*.png;*.gif&sid='+sid+'&nums=10&cid='+cid,'上传相册封面图片','90%','300px');
        }else{
            cscms.layer.msg('请先选择相册',{icon:2});
        }
    }
</script>
</body>
</html>